<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>个人修改</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<!--标准mui.css-->
		<link rel="stylesheet" href="css/mui.min.css">
		<!--App自定义的css-->
		<!--<link rel="stylesheet" type="text/css" href="css/app.css"/>-->
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">个人修改</h1>
		</header>
		<div class="mui-content">
			<div class="mui-card">
				<ul class="mui-table-view">
					<li class="mui-table-view-cell">
						<div class="mui-collapse-content">
							<form class="mui-input-group">
								<div class="mui-input-row">
									<label>账号：</label>
									<input type="text" id="Account" placeholder="请输入账号" disabled>
								</div>
								<div class="mui-input-row">
									<label>昵称：</label>
									<input type="text" id="UserName" class="mui-input-clear" placeholder="请输入昵称">
								</div>		
								<div class="mui-input-row">
									<label>密码：</label>
									<input type="password" id="Pwd" class="mui-input-clear" placeholder="请输入密码">
								</div>
								<div class="mui-button-row">
									<button class="mui-btn mui-btn-primary" type="button" onclick="User_Save();">确认</button>&nbsp;&nbsp;
									<button class="mui-btn" type="button" onclick="Core.Tool.Back()">取消</button>
								</div>
							</form>
						</div>
					</li>					
				</ul>
			</div>
		</div>
		<script src="js/mui.min.js"></script>
		<script src="js/jquery.min.js"></script>
		<script src="libs/lib.js"></script>
		<script>
			mui.init({
				swipeBack:true //启用右滑关闭功能
			});
			
			User_Get_Info();
			
			function User_Get_Info(){
				var user = Core.User.GetUser();
				document.getElementById("Account").value = user.account;
				document.getElementById("UserName").value = user.userName;
			}
			
			function User_Save(){
				var user = Core.User.GetUser();
				user.account = document.getElementById("Account").value;
				user.userName = document.getElementById("UserName").value;
				user.pwd = document.getElementById("Pwd").value;
				
				Core.Post("User/Edit", { Param: user }, function(result, status){
					if(result.errorMsg){
						Core.Msg.Alert(result.errorMsg);
						return;
					}
					Core.User.SetUser(user);
					Core.Tool.Back();
				});
			}
		</script>
	</body>

</html>